<?php

namespace app\model;

use app\BaseModel;
use think\model\relation\BelongsTo;

/**
 * 测评记录
 */
class EvaluationLogModel extends BaseModel
{
    protected $name = 'evaluation_log';

    public function unit(): BelongsTo
    {
        return $this->belongsTo(UnitModel::class, 'unit_id')->bind([
            'unit_name' => 'name'
        ]);
    }

    public function user(): BelongsTo
    {
        return $this->belongsTo(UserModel::class, 'uid')->bind([
            'user_name' => 'name',
            'department_id'
        ]);
    }

    public function ratingScale(): BelongsTo
    {
        return $this->belongsTo(RatingScaleModel::class, 'rating_scale_id')->bind([
            'rating_scale_name' => 'name'
        ]);
    }
}